Information processing apparatus capable of being instructed to power off by a command from external apparatus, method of controlling the same, and storage medium

ABSTRACT

An image processing apparatus that is capable of being instructed to power off, by a power switch or a command from an external apparatus, and is capable of executing the restart thereof under appropriate conditions. When power-off is instructed, shutdown is started. Upon completion of the shutdown, if the power switch is on, and at the same time the power-off has been instructed by the power switch of the apparatus, the restart of the apparatus is executed, whereas upon completion of the shutdown, if the power-off has been instructed by a command from the external apparatus, the restart of the apparatus is not executed.

This is a continuation of and claims benefit to U.S. patent applicationSer. No. 12/814,925, filed Jun. 14, 2010, pending, the content of whichis incorporated herein by reference. These applications claim priorityto JP Application No. 2009-146474, filed Jun. 19, 2009.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an information processing apparatusthat is capable of being instructed to power off by a command from anexternal apparatus, and a method of controlling the same.

2. Description of the Related Art

Some information processing apparatuses execute shutdown thereof uponturn-off of a power switch thereof, to thereby stop supply of electricpower thereto.

Japanese Patent Laid-Open Publication No. 2002-073220 discloses ashutdown control method of starting shutdown upon turn-off of a powerswitch, and checking a state of the power switch upon completion of theshutdown process. In the shutdown control method disclosed in JapanesePatent Laid-Open Publication No. 2002-073220, as a result of the check,if the power switch is off, the supply of electric power to theinformation processing apparatus is stopped, whereas if the power switchis on, the restart of the information processing apparatus is executed.

On the other hand, there has been disclosed a technique for turning offthe power of the information processing apparatus by a command from anexternal apparatus connected thereto e.g. via a network.

However, when the above-mentioned technique is applied to the shutdowncontrol method disclosed in Japanese Patent Laid-Open Publication No.2002-073220, the following problem occurs: When the power of theinformation processing apparatus is turned off by a command from theexternal apparatus, since the power switch remains on, the restart ofthe information processing apparatus is executed against an operator'swill.

SUMMARY OF THE INVENTION

The present invention provides an image processing apparatus that iscapable of being instructed to power off by a power switch or a commandfrom an external apparatus and is capable of executing the restartthereof under appropriate conditions.

In a first aspect of the present invention, there is provided aninformation processing apparatus connected to an external apparatus,comprising a power switch adapted to turn on or off power of theinformation processing apparatus, a reception unit adapted to receive acommand for turning off the power of the information processingapparatus from the external apparatus, an execution unit adapted toexecute shutdown of the information processing apparatus when turn-offof the power of the information processing apparatus has been instructedby the power switch or by the command received by the reception unit, afirst determination unit adapted to determine whether the power switchis on or off, a second determination unit adapted to determine whetherthe turn-off of the power of the information processing apparatus hasbeen instructed by the power switch or by the command received by thereception unit, and a control unit adapted to be operable uponcompletion of the shutdown by the execution unit, to control theinformation processing apparatus such that the information processingapparatus is restarted, when the first determination unit determinesthat the power switch is on, and at the same time when the seconddetermination unit determines that the turn-off of the power of theinformation processing apparatus has been instructed by the powerswitch, and to control the information processing apparatus such thatthe information processing apparatus is not restarted, when the seconddetermination unit determines that the turn-off of the power of theinformation processing apparatus has been instructed by the commandreceived by the reception unit.

In a second aspect of the present invention, there is provided a methodof controlling an information processing apparatus connected to anexternal apparatus, the information processing apparatus including apower switch adapted to turn on or off power of the informationprocessing apparatus, and a reception unit adapted to receive a commandfor turning off the power of the information processing apparatus fromthe external apparatus, the method comprising executing shutdown of theinformation processing apparatus when turn-off of the power of theinformation processing apparatus has been instructed by the power switchor by the command received by the reception unit, determining whetherthe power switch is on or off, determining whether the turn-off of thepower of the information processing apparatus has been instructed by thepower switch or by the command received by the reception unit, and uponcompletion of the shutdown, controlling the information processingapparatus such that the information processing apparatus is restarted,when it is determined that the power switch is on, and at the same timewhen it is determined that the turn-off of the power of the informationprocessing apparatus has been instructed by the power switch, andcontrolling the information processing apparatus such that theinformation processing apparatus is not restarted, when it is determinedthat the turn-off of the power of the information processing apparatushas been instructed by the command received by the reception unit.

In a third aspect of the present invention, there is provided anon-transitory computer-readable storage medium storing acomputer-executable program for implementing a method of controlling aninformation processing apparatus connected to an external apparatus, theinformation processing apparatus including a power switch adapted toturn on or off power of the information processing apparatus, and areception unit adapted to receive a command for turning off the power ofthe information processing apparatus from the external apparatus,wherein the method comprises executing shutdown of the informationprocessing apparatus when turn-off of the power of the informationprocessing apparatus has been instructed by the power switch or by thecommand received by the reception unit, determining whether the powerswitch is on or off, determining whether the turn-off of the power ofthe information processing apparatus has been instructed by the powerswitch or by the command received by the reception unit, and uponcompletion of the shutdown, controlling the information processingapparatus such that the information processing apparatus is restarted,when it is determined that the power switch is on, and at the same timewhen it is determined that the turn-off of the power of the informationprocessing apparatus has been instructed by the power switch, andcontrolling the information processing apparatus such that theinformation processing apparatus is not restarted, when it is determinedthat the turn-off of the power of the information processing apparatushas been instructed by the command received by the reception unit.

According to the present invention, it is possible to restart theinformation processing apparatus which is capable of being instructed topower off by a power switch or a command from an external apparatus,under appropriate conditions.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a printer.

FIG. 2 is a block diagram of a power supply controller.

FIG. 3 is a block diagram of a shutdown controller.

FIG. 4 is a timing diagram showing states of control signals duringpower-off processing in a case where a power switch is turned off but isnot turned on again.

FIG. 5 is a timing diagram showing states of the control signals duringthe power-off processing in a case where the power switch is turned offand is then turned on again.

FIG. 6 is a timing diagram showing states of the control signals duringthe power-off processing in a case where power-off is instructed by aremote operation.

FIG. 7 is a flowchart of a power-off control process executed based bysoftware in a variation of the present embodiment.

DETAILED DESCRIPTION OF THE EMBODIMENTS

The present invention will now be described in detail below withreference to the accompanying drawings showing embodiments thereof.

The following description will be given by taking a printer as anexample of an information processing apparatus according to anembodiment of the present invention, and a PC as an example of anexternal apparatus, but the information processing apparatus and theexternal apparatus are by no means limited to these examples.

Further, in the following description, a term “power-off processing” isintended to mean processing for turning off the power of the apparatus,and is assumed to include shutdown of the apparatus and stoppage of thesupply of electric power to the apparatus.

Further, in the following description, the term “shutdown” is intendedto mean execution of a series of processing operations including closingof files, termination of application programs, disconnection ofcommunication with input/output apparatuses, and termination of anoperating system (OS).

Further, in the following description, the term “restart” is intended tomean execution of a series of processing operations including starting abasic input output system (BIOS) and the OS, after completion of theshutdown.

FIG. 1 is a block diagram of the printer as the information processingapparatus according to the present embodiment.

The printer 1 is communicably connected to the PC 2 over a network via anetwork interface 25. The printer 1 is capable of receiving a commandfor turning off the power of the printer 1 from the PC 2.

The printer 1 comprises a power switch section 10, a power relay section11, an AC/DC power supply section 12, a controller section 13, and aprinter section 19.

The power switch section 10 includes a power switch 101 (see FIG. 2) forinstructing to turn on or off the supply of electric power from analternating current (AC) power supply. This power switch 101 is asolenoid switch. The solenoid switch is formed by a switch and anactuator, neither of which is shown. The switch is configured such thatit can be manually or automatically turned on and off. The actuator isformed by a solenoid and an iron core (disposed in the solenoid),neither of which is shown, and is capable of automatically turning onand off the switch by causing electric current to flow through thesolenoid to thereby cause the iron core to operate. Further, the powerswitch section 10 has the function of notifying a power supplycontroller 14 of the on/off state of the power switch 101.

The power relay section 11 is provided for supplying external AC powerto the AC/DC power supply section 12 according to a signal from thepower supply controller 14 even when the power switch 101 is off.

The AC/DC power supply section 12 converts the externally-supplied ACpower into DC power so as to supply the DC power to devices, such as thecontroller section 13 and the printer section 19.

The controller section 13 includes the power supply controller 14, areset section 15, a HDD (Hard Disk Drive) 16, a CPU (Central ProcessingUnit) 17, and a memory 18.

The power supply controller 14 connected to the CPU 17 via a CPUinterface 29 detects the on/off state of the power switch 101, anddelivers instruction signals for instructing processing, such aspower-on processing, reset processing, and the power-off processing.

The reset section 15 performs the reset processing of the whole hardwareof the controller section 13 according to a reset instruction signalfrom the power supply controller 14 e.g. when the computer system isrestarted.

The HDD 16 connected to the CPU 17 via a HDD interface 30 stores varioussoftware and data executed by the computer system. Further, the HDD 16stores the OS, various application programs (control programs) forcarrying out information processing specific to the apparatus, and thelike. The control programs include a control program associated with thepower-off processing.

The CPU 17 executes the power-off processing, the reset processing, andthe like, based on the signals from the power supply controller 14, andcontrols the overall operation of the system concerning the printer 1.

The memory 18 connected to the CPU 17 via a memory interface 26 isformed by a volatile memory, such as a DDR SDRAM (Double-Data-RateSynchronous Dynamic Random Access Memory), and is used e.g. as a workarea of the CPU 17.

The printer section 19 connected to the CPU 17 via a printer interface28 executes print processing under the control of the CPU 17.

An operating section 20 connected to the CPU 17 via an operating sectioninterface 27 includes a display screen and an input button, and acceptsvarious operations from an operator.

FIG. 2 is a block diagram of the power supply controller 14.

The power supply controller 14 includes a shutdown controller 140, aninterrupt controller 141, and a relay controller 142.

The shutdown controller 140 receives a switch-state signal (signalindicative of the on/off state of the power switch 101) from the powerswitch section 10 including the power switch 101, and a relay-offinstruction signal from the relay controller 142. Then, when theshutdown controller 140 determines based on the switch-state signal andthe relay-off instruction signal that a power-off instruction operationhas been performed by a remote operation, the shutdown controller 140delivers a power switch control signal for causing the power switchsection 10 to perform the power-off processing, to the power switchsection 10. Further, when the switch-state signal changes from the onstate to the off state, and then changes to the on state again, theshutdown controller 140 delivers the reset instruction signal to thereset section 15 to reset the hardware. This enables the CPU 17 torestart the computer system in a state where the hardware thereof isreset.

The interrupt controller 141 receives the switch-state signal indicativeof the on/off state of the power switch 101 from the power switchsection 10, to thereby monitor the on/off state of the power switch 101.When the power switch 101 changes from the on state to the off state,the interrupt controller 141 asserts an interrupt signal to the CPU 17to thereby notify the CPU 17 that the power switch 101 has been turnedoff.

The relay controller 142 delivers the relay-off instruction signal tothe power relay section 11 in response to an instruction signal from theCPU 17.

FIG. 3 is a block diagram of the internal configuration of the shutdowncontroller 140.

The shutdown controller 140 includes AND circuits 1400, 1403, and 1405,NOT circuits 1401 and 1404, and a flip-flop (FF) circuit 1402.

The AND circuit 1400 delivers a logical product of the relay-offinstruction signal and the switch-state signal to the AND circuits 1403and 1405 as a signal 2.

The NOT circuit 1401 inverts the switch-state signal, and inputs thesame to the flip-flop circuit 1402.

The flip-flop circuit 1402 holds a state of change in the switch-statesignal switched between on and off, and outputs the state to the ANDcircuits 1403 and 1405 as a signal 1. To the AND circuit 1405, thesignal 1 is delivered via the NOT circuit 1404.

The AND circuit 1403 delivers as an output a reset instruction signal tothe reset section 15. Further, the AND circuit 1405 delivers as anoutput a power switch control signal to the power switch section 10.

With the arrangement shown in FIGS. 1 to 3, the power supply controller14 performs the power-off processing. The above-mentioned signals areoutput from the component circuits of the shutdown controller 140 of thepower supply controller 14, as shown in the following timing diagrams inFIGS. 4 to 6.

FIG. 4 is a timing diagram showing the states of the control signalsduring the power-off processing executed in the present embodiment in acase where the power switch 101 is turned off but is not turned onagain.

Here, during normal operation, the relay controller 142 sets therelay-off instruction signal to a low level to set the power relaysection 11 to the on state so as to enable AC power to be supplied tothe AC/DC power supply section 12 even when the power switch 101 isturned off against a user's will.

The interrupt controller 141 monitors the state of change between on andoff of the switch-state signal output from the power switch section 10.

When the switch-state signal changes from on (high level) to off (lowlevel), the interrupt controller 141 asserts the interrupt signal to theCPU 17 to thereby notify the CPU 17 that the power switch 101 has beenturned off.

Further, when the switch-state signal changes from on to off, as shownin FIG. 4, the signal 1 output from the flip-flop circuit 1402 changesto the high level.

When the interrupt signal is asserted, the CPU 17 executes software forshutdown.

When the shutdown of the HDD 16 etc. is completed, the CPU 17 notifiesthe relay controller 142 of the completion of the shutdown.

Upon receipt of the notification of the completion of the shutdown, asshown in FIG. 4, the relay controller 142 changes the relay-offinstruction signal to the high level to set the power relay section 11to the off state.

It should be noted, as shown in FIG. 4, when the switch-state signal ofthe power switch 101 only changes from on to off, the signal 2 outputfrom the AND circuit 1400, the reset instruction signal output from theAND circuit 1403, and the power switch control signal output from theAND circuit 1405 remains at the low level without being changed.

After the shutdown is started by the above-described sequence of changesin the control signals and is then completed, the power switch 101 ofthe power switch section 10 and the power relay section 11 are bothturned off, whereby the power-off is completed.

FIG. 5 is a timing diagram showing states of the control signals duringthe power-off processing executed in the present embodiment in a casewhere the power switch 101 is turned on again after being turned off.

As described above, when the power switch 101 is turned off, the CPU 17starts shutdown by software.

When the power switch 101 is turned off, as shown in FIG. 5, the signal1 output from the flip-flop circuit 1402 changes to the high level.

When the state of the power switch 101 changes from off to on beforecompletion of the shutdown process or before the relay controller 142sets the power relay section 11 to the off state after completion of theshutdown process, i.e. when the user instructs to restart the computersystem, the relay-off instruction signal and the switch-state signalboth change to the high level.

This causes the signal 2 delivered from the AND circuit 1400 to changefrom the low level to the high level.

Further, since the signal 1 and the signal 2 change to the high level,the reset instruction signal output from the AND circuit 1403 changesfrom the low level to the high level.

When the reset instruction signal changes to the high level, the resetsection 15 asserts a hardware reset line for a required time period, tothereby reset the CPU 17 and peripheral hardware of the CPU 17.

Then, the CPU 17 restarts the system based on predetermined software forrestart.

FIG. 6 is a timing diagram showing states of the control signals duringthe power-off processing executed in the present embodiment in a casewhere power-off is instructed by a remote operation.

An operation signal for switching off the power is directly input by aremote operation from the PC 2 to the CPU 17 via the network interface25 connected to the CPU 17.

When the operation signal for switching off the power is input by aremote operation from the PC 2, the CPU 17 executes the shutdownsoftware.

In this case, as shown in FIG. 6, the power switch 101 is held in the onstate without being changed so that the switch-state signal remains atthe high level, and hence the signal 1 output from the flip-flop circuit1402 remains at the low-level.

Immediately before the relay controller 142 sets the power relay section11 to the off state after completion of the shutdown process, the powerswitch 101 is in the on state, so that as shown in FIG. 6, the relay-offinstruction signal and the switch-state signal are both at the highlevel.

This causes the signal 2 output from the AND circuit 1400 to change tothe high level.

Further, the signal 1 is logically inverted by the NOT circuit 1404 intothe high level, and the signal 2 as well has changed to the high levelas mentioned above, so that as shown in FIG. 6, the power switch controlsignal output from the AND circuit 1405 changes to the high level.

When the power switch control signal changes to the high level, thepower switch section 10 sets the power switch 101 implemented by thesolenoid switch to the off state.

The above-described sequence of processing causes both the power switchsection 10 and the power relay section 11 to change to the off state,whereby the power-off of the printer 1 is completed.

Next, a variation of the present embodiment in which the functions ofthe shutdown controller 140 for executing the above-described processingfor delivering the reset instruction signal and the power switch controlsignal are realized by software for executing a power-off controlprocess, without using the above-described logic circuit shown in FIG.3.

FIG. 7 is a flowchart of the power-off control process executed by thesoftware by the CPU 17 in the variation of the present embodiment.

First, the CPU 17 receives an interrupt signal from the interruptcontroller 141 when the power switch 101 is turned off, or receives apower-off instruction signal transmitted from the PC 2 by a remoteoperation, whereby a power-off instruction is input thereto (step S701).

Next, the CPU 17 stores information indicative of the above (informationindicative of whether the power-off instruction received in the stepS701 has been given by the power switch 101 of the printer or by apower-off command from the PC) (step S702).

Next, the CPU 17 executes the shutdown of the printer 1 by software(step S703). When the shutdown is completed in the step S703, theprocess proceeds to a step S704.

Next, the CPU 17 checks the state of the power switch 101 of the powerswitch section 10 to determine whether the power switch 101 is on or off(first determination) (step S704). The case where it is determined inthe step S704 that the power switch 101 is on corresponds e.g. to a casewhere the power switch 101 is directly turned on after being directlyturned off, or a case where the power-off is instructed by a commandfrom the external apparatus. Further, the case where it is determined inthe step S704 that the power switch 101 is off corresponds e.g. to acase where the power switch 101 is not directly turned on after beingdirectly turned off. If it is determined in the step S704 that the powerswitch 101 is on, the process proceeds to a step S705. If it isdetermined in the step S704 that the power switch 101 is off, theprocess proceeds to a step S710.

If it is determined in the step S704 that the power switch 101 is on,the CPU 17 performs the following processing:

First, the CPU 17 determines based on the information stored in the stepS702 whether the power-off instruction input in the step S701 has beengiven by the power switch 101 of the printer 1 or by the power-offcommand from the PC (second determination) (step S705). If it isdetermined in the step S705 that the power-off instruction input in thestep S701 has been given by the power-off command from the PC 2, theprocess proceeds to a step S706. If it is determined in the step S705that the power-off instruction input in the step S701 has been given bythe power switch 101 of the printer 1, the process proceeds to a stepS708.

If it is determined in the step S705 that the power-off instructioninput in the step S701 has been given by the power-off command from thePC 2, the CPU 17 executes the following processing:

First, the CPU 17 sets the power relay section 11 to the off state viathe relay controller 142 (step S706).

Next, the CPU 17 displays a message for prompting the operator to turnoff the power switch 101, on the display screen, not shown, of theoperating section 20, and waits for the operator of the printer 1 toturn off the power switch 101 of the power switch section 10 (stepS707). As the prompting message, there may be displayed a message sayingthat e.g. “Shutdown has been completed. Please turn off the power switch101”. This makes it unnecessary for the operator to wait for completionof the shutdown process in front of the printer after the operator givesa power-off instruction by directly turning off the power switch 101.

In the step S707, the power switch 101 of the power switch section 10may be automatically turned off instead of displaying the message andwaiting for the operator to turn off the power switch 101. In this case,the power switch 101 may be forcibly turned off e.g. by applying voltageto the actuator of the power switch 101. This makes it unnecessary forthe operator to go to the printer so as to turn off the power supply ofthe printer.

Thus, since the power relay section 11 and the power switch 101 areturned off, the supply of electric power to the printer 1 is stopped.

If it is determined in the step S705 that the power-off instructioninput in the step S701 has been given by the power switch 101 of theprinter 1, the CPU 17 executes the following processing:

First, the CPU 17 sets the power relay section 11 to the off state viathe relay controller 142 (step S708). At this time, the power switch 101is in the on state, so that even when the power relay section 11 isturned off, the supply of electric power to the printer 1 is continued.Further, if processing for turning on the power relay section 11 is notincluded in processing executed in a step S709, referred to hereinafter,for restarting the system, the step S708 may be omitted (the power relaysection 11 may be held in the on state).

Next, the CPU 17 restarts the system (step S709). It is assumed in thepresent example that the process for turning on the power relay section11 is included in the processing for restarting the system.

Thus, the apparatus is restarted to continue supplying electric power tothe printer 1.

If it is determined in the step S704 that the power switch 101 is off,the CPU 17 executes the following processing:

First, the CPU 17 sets the power relay section 11 to the off state viathe relay controller 142 (step S710).

This places both the power relay section 11 and the power switch 101 inthe off state, and hence the supply of electric power to the printer 1is stopped.

According to the present embodiment, it is possible to execute therestart of a printer which is capable of being instructed to power offby a power switch or a command from a PC, under appropriate conditions.

Aspects of the present invention can also be realized by a computer of asystem or apparatus (or devices such as a CPU or MPU) that reads out andexecutes a program recorded on a memory device to perform the functionsof the above-described embodiment(s), and by a method, the steps ofwhich are performed by a computer of a system or apparatus by, forexample, reading out and executing a program recorded on a memory deviceto perform the functions of the above-described embodiment(s). For thispurpose, the program is provided to the computer for example via anetwork or from a recording medium of various types serving as thememory device (e.g., computer-readable medium).

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2009-146474, filed Jun. 19, 2009, which is hereby incorporated byreference herein in its entirety.

1. An information processing apparatus which is able to communicate withan external apparatus, comprising: a power switch adapted to turn on oroff power of the information processing apparatus; a reception unitadapted to receive a command for turning off the power of theinformation processing apparatus from the external apparatus; anexecution unit adapted to execute shutdown of the information processingapparatus in response to turning off of the power switch or receiving ofthe command from the external apparatus; and a control unit adapted tocontrol, in case that the execution unit executes shutdown of theinformation processing apparatus in response to turning off of the powerswitch, to restart the information processing apparatus when the powerswitch is on at completion of the shutdown of the information processingapparatus, and to turn off the power of the information processingapparatus when the power switch is off at completion of the shutdown ofthe information processing apparatus, and, in case that the executionunit executes shutdown of the information processing apparatus inresponse to receiving of the command from the external apparatus, toturn off the power of the information processing apparatus regardless ofa state of the power switch at completion of the shutdown of theinformation processing apparatus.
 2. The information processingapparatus according to claim 1, wherein the control unit is adapted toturn off the power switch automatically, in case that the execution unitexecutes shutdown of the information processing apparatus in response toreceiving of the command from the external apparatus.
 3. The informationprocessing apparatus according to claim 1, wherein the control unit isadapted to prompt a user to turn off the power switch, in case that theexecution unit executes shutdown of the information processing apparatusin response to receiving of the command from the external apparatus. 4.The information processing apparatus according to claim 1, wherein theshutdown includes at least one of processing operations includingclosing of files, termination of application programs, disconnection ofcommunication with input/output apparatuses, and termination of anoperating system (OS).
 5. The information processing apparatus accordingto claim 1 further comprising a print unit adapted to perform printing.6. An information processing apparatus which is able to communicate withan external apparatus, comprising: a power switch adapted to turn on oroff power of the information processing apparatus; a reception unitadapted to receive a command for turning off the power of theinformation processing apparatus from the external apparatus; anexecution unit adapted to execute shutdown of the information processingapparatus in response to turning off of the power switch or receiving ofthe command from the external apparatus; and a control unit adapted toturn off the power switch automatically, in case that the execution unitexecutes shutdown of the information processing apparatus in response toreceiving of the command from the external apparatus.
 7. A method forcontrolling an information processing apparatus connectable to anexternal apparatus, the information processing apparatus including apower switch for turning on or off power of the information processingapparatus, the method comprising: receiving a command for turning offthe power of the information processing apparatus from the externalapparatus; executing shutdown of the information processing apparatus inresponse to turning off of the power switch or receiving of the commandfrom the external apparatus; and controlling, in case that the executionunit executes shutdown of the information processing apparatus inresponse to turning off of the power switch, to restart the informationprocessing apparatus when the power switch is on at completion of theshutdown of the information processing apparatus, and to turn off thepower of the information processing apparatus when the power switch isoff at completion of the shutdown of the information processingapparatus, and, in case that the execution unit executes shutdown of theinformation processing apparatus in response to receiving of the commandfrom the external apparatus, to turn off the power of the informationprocessing apparatus regardless of a state of the power switch atcompletion of the shutdown of the information processing apparatus.
 8. Anon-transitory computer-readable storage medium having stored therein aprogram for causing a computer to implement a method for controlling aninformation processing apparatus connectable to an external apparatus,the information processing apparatus including a power switch forturning on or off power of the information processing apparatus, themethod comprising: receiving a command for turning off the power of theinformation processing apparatus from the external apparatus; executingshutdown of the information processing apparatus in response to turningoff of the power switch or receiving of the command from the externalapparatus; and controlling, in case that the execution unit executesshutdown of the information processing apparatus in response to turningoff of the power switch, to restart the information processing apparatuswhen the power switch is on at completion of the shutdown of theinformation processing apparatus, and to turn off the power of theinformation processing apparatus when the power switch is off atcompletion of the shutdown of the information processing apparatus, and,in case that the execution unit executes shutdown of the informationprocessing apparatus in response to receiving of the command from theexternal apparatus, to turn off the power of the information processingapparatus regardless of a state of the power switch at completion of theshutdown of the information processing apparatus.